import { ApiProperty, PartialType } from '@nestjs/swagger';
import { ResFailDto, ResSuccessDto } from 'src/shared-module/dto/base.dto';
import { DynamicItem } from 'src/tag/entities/tag.entity';

export class GetDynamicItemReqDto {
  @ApiProperty({
    required: true,
    description: '0 表示第一页。',
  })
  page: string;

  @ApiProperty({
    required: true,
  })
  page_size: string;
}

export class GetDynamicItemResSuccessDto extends PartialType(ResSuccessDto) {
  @ApiProperty({
    required: true,
    type: 'array',
    items: {
      type: 'object',
      default: {
        openid: '',
        article: '',
        author: '',
        background: '',
        head_image: '',
        tomato: 0,
        _id: '',
        tagnames: [],
      },
    },
  })
  dynamics: DynamicItem[];
}

export class GetDynamicItemResFailDto extends PartialType(ResFailDto) {}
